Update Microsoft.Data.Sqlite TFMs: replace netstandard2.0 with net472#37877
Update Microsoft.Data.Sqlite TFMs: replace netstandard2.0 with net472#37877
Conversation
…et472 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
…rectory Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates Microsoft.Data.Sqlite.Core and Microsoft.Data.Sqlite (the meta-package) to replace their netstandard2.0 target framework moniker with an explicit net472 target, using the Arcade SDK's $(NetFrameworkToolCurrent) property. This change makes it clear that only .NET Framework 4.7.2 and the current minimum supported .NET ($(NetMinimum) = net10.0) are supported, removing the misleading implicit compatibility with older .NET versions like net8.0.
Changes:
Microsoft.Data.Sqlite.Core.csproj: Swapsnetstandard2.0for$(NetFrameworkToolCurrent)inTargetFrameworks.Microsoft.Data.Sqlite.csproj(meta-package): Switches from a singleTargetFramework=netstandard2.0to multi-TFMTargetFrameworks=$(NetMinimum);$(NetFrameworkToolCurrent), adds an emptyCheckForAnyCPUtarget to suppress architecture checks, and adds aCheckNetMinimumLibDirectorybuild guard that fails when$(NetMinimum)is no longernet10.0.lib/placeholder files: Removeslib/netstandard2.0/_._and addslib/net10.0/_._andlib/net472/_._.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.csproj |
Replaces netstandard2.0 with $(NetFrameworkToolCurrent) (net472) in TargetFrameworks |
src/Microsoft.Data.Sqlite/Microsoft.Data.Sqlite.csproj |
Switches to multi-TFM $(NetMinimum);$(NetFrameworkToolCurrent), adds CheckForAnyCPU override and CheckNetMinimumLibDirectory build guard |
src/Microsoft.Data.Sqlite/lib/net10.0/_._ |
New placeholder enabling the net10.0 dependency group in the NuGet package |
src/Microsoft.Data.Sqlite/lib/net472/_._ |
New placeholder enabling the net472 dependency group in the NuGet package |
You can also share your feedback on Copilot code review. Take the survey.
| <Target Name="CheckNetMinimumLibDirectory" BeforeTargets="Build"> | ||
| <Error | ||
| Condition="'$(NetMinimum)' != 'net10.0'" | ||
| Text="NetMinimum has changed to '$(NetMinimum)'. Rename the 'lib\net10.0' directory to 'lib\$(NetMinimum)'." /> | ||
| </Target> |
There was a problem hiding this comment.
The CheckNetMinimumLibDirectory target uses BeforeTargets="Build" in a multi-TFM project (TargetFrameworks=$(NetMinimum);$(NetFrameworkToolCurrent)). In MSBuild, BeforeTargets="Build" fires in each inner per-TFM build, causing this error check to run twice (once per TFM). While this is benign since the check is idempotent, using BeforeTargets="DispatchToInnerBuilds" (which fires only once in the outer build) would be more precise and efficient, and would avoid a duplicate error message if the condition is true. Alternatively, adding a condition like Condition="'$(TargetFramework)' == '$(NetMinimum)'" ensures it runs only once.
netstandard2.0implied support for older .NET TFMs (e.g. net8.0) that are no longer supported, and masked the lack ofDateOnly/TimeOnlysupport on those targets. This replaces it with an explicitnet472target for .NET Framework support.Changes
Microsoft.Data.Sqlite.Core.csproj:TargetFrameworkschanged from$(NetMinimum);netstandard2.0→$(NetMinimum);$(NetFrameworkToolCurrent)(net10.0;net472)Microsoft.Data.Sqlite.csproj(meta-package):TargetFramework=netstandard2.0→TargetFrameworks=$(NetMinimum);$(NetFrameworkToolCurrent)<Target Name="CheckForAnyCPU" />to suppress the native SQLite architecture check during CI builds — this packaging-only project performs no native compilation, so the check is irrelevant here; it still fires correctly in end-user projects viabuildTransitiveCheckNetMinimumLibDirectorybuild target that emits an error when$(NetMinimum)is no longernet10.0, reminding to renamelib\net10.0tolib\$(NetMinimum)lib/placeholders: Replacedlib/netstandard2.0/_._withlib/net10.0/_._andlib/net472/_._The resulting NuGet packages now have explicit
net10.0and.NETFramework4.7.2dependency groups in the nuspec instead of a singlenetstandard2.0group.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.